
public class DEMO02 {

	public static void main(String[] args) {
		int a [] = {70,10,20,30,40};
		for (int i = 0; i < 2; i++) {
			System.out.print(aa(a)[i]);
			System.out.print(" ");
		}
		
	}
	
	
    public static int[] aa(int[] a ) {
    	int abc[] = new int [2];
    	int max=a[0];
    	int min=a[0];
    	for (int i = 0; i < a.length; i++) {
			if (a[i]>max) {
				max=a[i];
			}
			if (a[i]<min) {
				min=a[i];
			}
		}
     abc[0] = max;
     abc[1] = min;
     return abc;
    }
	}


